package 电信数据清洗;

import org.apache.hadoop.io.WritableComparable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class Data implements WritableComparable<Data> {
    private String name_A;
    private String name_B;
    private String phoneNum_A;
    private String phoneNum_B;
    private String startTime;
    private String endTime;
    private String phoneLong;
    private String location_A;
    private String location_B;

    @Override
    public int compareTo(Data o) {
        return 0;
    }

    @Override
    public void write(DataOutput dataOutput) throws IOException {
        dataOutput.writeUTF(name_A);
        dataOutput.writeUTF(name_B);
        dataOutput.writeUTF(phoneNum_A);
        dataOutput.writeUTF(phoneNum_B);
        dataOutput.writeUTF(startTime);
        dataOutput.writeUTF(endTime);
        dataOutput.writeUTF(phoneLong);
        dataOutput.writeUTF(location_A);
        dataOutput.writeUTF(location_B);
    }

    @Override
    public void readFields(DataInput dataInput) throws IOException {
        name_A = dataInput.readUTF();
        name_B = dataInput.readUTF();
        phoneNum_A = dataInput.readUTF();
        phoneNum_B = dataInput.readUTF();
        startTime = dataInput.readUTF();
        endTime = dataInput.readUTF();
        phoneLong = dataInput.readUTF();
        location_A = dataInput.readUTF();
        location_B = dataInput.readUTF();
    }

    public void set(String name_A, String name_B, String phoneNum_A, String phoneNum_B, String startTime, String endTime, String phoneLong, String location_A, String location_B) {
        this.name_A = name_A;
        this.name_B = name_B;
        this.phoneNum_A = phoneNum_A;
        this.phoneNum_B = phoneNum_B;
        this.startTime = startTime;
        this.endTime = endTime;
        this.phoneLong = phoneLong;
        this.location_A = location_A;
        this.location_B = location_B;
    }

    @Override
    public String toString() {
        return name_A + "," +
                name_B + "," +
                phoneNum_A + "," +
                phoneNum_B + "," +
                startTime + "," +
                endTime + "," +
                phoneLong + "," +
                location_A + "," +
                location_B
                ;
    }

    public String getName_A() {
        return name_A;
    }

    public void setName_A(String name_A) {
        this.name_A = name_A;
    }

    public String getName_B() {
        return name_B;
    }

    public void setName_B(String name_B) {
        this.name_B = name_B;
    }

    public String getPhoneNum_A() {
        return phoneNum_A;
    }

    public void setPhoneNum_A(String phoneNum_A) {
        this.phoneNum_A = phoneNum_A;
    }

    public String getPhoneNum_B() {
        return phoneNum_B;
    }

    public void setPhoneNum_B(String phoneNum_B) {
        this.phoneNum_B = phoneNum_B;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getPhoneLong() {
        return phoneLong;
    }

    public void setPhoneLong(String phoneLong) {
        this.phoneLong = phoneLong;
    }

    public String getLocation_A() {
        return location_A;
    }

    public void setLocation_A(String location_A) {
        this.location_A = location_A;
    }

    public String getLocation_B() {
        return location_B;
    }

    public void setLocation_B(String location_B) {
        this.location_B = location_B;
    }
}
